#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
ll a[N],n,sum;
void solve()
{
	cin>>n>>sum;
	for(int i=1;i<=n;i++)//从0开始走,到i花费i,传送门ai 共ai+i
	{
		cin>>a[i];
		a[i]=a[i]+i;
	}
	sort(a+1,a+n+1);
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		if(sum-a[i]>=0)
		{
			ans++;
			sum-=a[i];
		}
		else break;
	}
	cout<<ans<<'\n';

	
}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}
//从0开始走, 1-n才有传送门